//
//  mapping.hpp
//  NLCEQ_mixed
//
//  Created by Duong Ngo on 8/13/16.
//  Copyright © 2016 Duong Ngo. All rights reserved.
//

#ifndef mapping_hpp
#define mapping_hpp

#include <stdio.h>
#include <vector>
#include <map>

#include "IpTNLP.hpp"
#include "global.hpp"

using namespace Ipopt;

//-----------------------------------------------------------------------------
// Find the original map f: name of variables --> its position
//-----------------------------------------------------------------------------
void find_original_map (std::map<std::string,int>& f);

//-----------------------------------------------------------------------------
// Find the equation map f: name of equation --> its position
//-----------------------------------------------------------------------------
void find_equation_map (std::map<std::string,int>& f);

//-----------------------------------------------------------------------------
// Find position of state variables and foward variables
//-----------------------------------------------------------------------------
void find_positions_of_state_and_forward_variables (std::vector<int>& state_position, std::vector<int>& forward_position, std::vector<int>& var_role);

//-----------------------------------------------------------------------------
// Find the map f: name of variables --> its position
//-----------------------------------------------------------------------------
void find_variable_s_at_time_t (const int& t, const Number* x, variables& s);

//-----------------------------------------------------------------------------
// Find the map f: name of variables --> its position
//-----------------------------------------------------------------------------
void find_map_at_time_t (const int& t, std::map<std::string,int>& f);

#endif /* mapping_hpp */
